package com.rose.ware.ware.dao;

import com.rose.ware.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author rose
 * @email 1942951600@qq.com
 * @date 2021-06-08 16:47:38
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

//    Boolean getSkuStock(Long id);
    //抄都能抄错 我也是服了
    Long getSkuStock(@Param("id") Long id);

    List<Long> listWareIdHasStock(@Param("skuId") Long skuId);


    Long lockSkuStock(@Param("skuId") Long skuId,@Param("wareId") Long wareId, @Param("num") Integer num);

//    void unlockStock(Long skuId, Long wareId, Integer num);
    void unlockStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);

}
